#!/home/dechao_meng/anaconda3/bin/python
from selenium import webdriver
import time
chrome = webdriver.Chrome()

def log(msg):
    print("[{}] {}".format(time.asctime(), msg))
def login_srun3000():
    chrome.get("https://gw.ict.ac.cn")
    username = chrome.find_element_by_name('username')
    username.clear()
    username.send_keys('mengdechao')
    password = chrome.find_element_by_name('password')
    password.clear()
    password.send_keys('mengdechao1234')

    button = chrome.find_element_by_id('button')
    button.click()
while True:
    log("Trying to connect srun3000...")
    login_srun3000()
    time.sleep(60 * 60)
    
